<div id="content" class="postie">
	<h1><?=$data->TITLE?></h1>
	<?
	$j = 0;
	if($data->postie->conversations) foreach ($data->postie->conversations as $i){
	?>
	<div id="C<?=$i->ID?>" class="conversation <?=((++$j)%2)?'light':'dark'?>">
		<?
		$p = $i->recipient;
		include 'apps/profile/template/mini.html';
		?>
		<a class="recipientName" href="/profile/<?=$i->recipient->ID?>" title="<?=$i->recipient->name?>"><?=$i->recipient->name?></a>
		<a class="conversationTitle <?=($i->unread)?'unread':'read'?>" href="/postie/conversation/<?=$i->ID?>" title="<?=_('Click to read.')?>">
			<?=$i->title?>
		</a>
		<span class="messageDate"><?=common::date($i->date)?></span>
		<a class="lastMessage <?=($i->unread)?'unread':''?>" href="/postie/conversation/<?=$i->ID?>" title="<?=_('Click to read.')?>">
			<?=substr($i->message,0,59)?>...
		</a>
		<a class="conversationDelete" onclick="remove('<?=$i->ID?>');" title="<?=_('Delete this conversation.')?>">&nbsp;</a>
        <span class="clear"></span>
	</div>
	<? } ?>
</div>
<div id="aside"></div>
<script type="text/javascript">
    function remove(ID, c){
        if(c)
            tool.post({'url':'/json/<?=APP?>/<?=CMD?>',
                'data':'CID='+ID,
                'onComplete':function(e){
                    if(e.code==200) $('#C'+ID).fadeOut();
                    else return tool.result("<?=_('Alert')?>"
                    ,"<?=_('Please try again later..')?>",400);
                }
        });
        else
            tool.confirm('<?=_("Confirm")?>',
        '<?=_("Are you sure delete this conversation?")?>'
        ,'remove('+ID+', 1)');
    }
</script>
